package cn.model;

import cn.util.Toolsutil;

import java.sql.Timestamp;

public class TRole {
    private int roleid;
    private String rolename;
    private String createtime;
    private String description;
    private Integer deepth;
    private Integer parentid;

    public int getRoleid() {
        return roleid;
    }

    public void setRoleid(int roleid) {
        this.roleid = roleid;
    }

    public String getRolename() {
        return rolename;
    }

    public void setRolename(String rolename) {
        this.rolename = rolename;
    }

    public String getCreatetime() {
        return Toolsutil.GetDateFormat(createtime);
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getDeepth() {
        return deepth;
    }

    public void setDeepth(Integer deepth) {
        this.deepth = deepth;
    }

    public Integer getParentid() {
        return parentid;
    }

    public void setParentid(Integer parentid) {
        this.parentid = parentid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TRole tRole = (TRole) o;

        if (roleid != tRole.roleid) return false;
        if (rolename != null ? !rolename.equals(tRole.rolename) : tRole.rolename != null) return false;
        if (createtime != null ? !createtime.equals(tRole.createtime) : tRole.createtime != null) return false;
        if (description != null ? !description.equals(tRole.description) : tRole.description != null) return false;
        if (deepth != null ? !deepth.equals(tRole.deepth) : tRole.deepth != null) return false;
        if (parentid != null ? !parentid.equals(tRole.parentid) : tRole.parentid != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = roleid;
        result = 31 * result + (rolename != null ? rolename.hashCode() : 0);
        result = 31 * result + (createtime != null ? createtime.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (deepth != null ? deepth.hashCode() : 0);
        result = 31 * result + (parentid != null ? parentid.hashCode() : 0);
        return result;
    }
}
